package com.example.controller;

import com.example.api.CoffApi;
import com.example.api.entity.Coffee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController()
@RequestMapping("/feign")
public class FeignController {
    @Autowired
    private CoffApi coffApi;

    @GetMapping("/list")
    public List<Coffee> getList(){
        System.out.println("使用feign远程调用的方法");
        return coffApi.getList();
    }
}
